﻿using System.Data.Common;

namespace DataAccess
{
    public interface IEntityConverter<T>
    {
        /// <summary>
        /// Gets value form data reader then convert it to object.
        /// </summary>
        /// <param name="dr">data reader</param>
        /// <returns>entity object</returns>
        T Convert(DbDataReader dr);

        /// <summary>
        /// Gets value form data reader then convert it to object.
        /// </summary>
        /// <param name="dr">data reader</param>
        /// <param name="convert">data convertor</param>
        /// <returns>entity object</returns>
        T Convert(DbDataReader dr, IValueTypeConverter convert);
    }
}
